# -*- encoding=utf8 -*-
__author__ = "taozhen"

from airtest.core.api import *

auto_setup(__file__)

start_app("com.rongyi.custom")


wait(Template(r"tpl1589442910561.png", record_pos=(-0.008, -0.647), resolution=(1080, 1920)),timeout=45)
assert_exists(Template(r"tpl1589442927847.png", record_pos=(-0.004, -0.615), resolution=(1080, 1920)), "判断轮播图视频是否存在")
wait(Template(r"tpl1589442962491.png", record_pos=(0.016, -0.611), resolution=(1080, 1920)),timeout=15)
assert_exists(Template(r"tpl1589442981169.png", record_pos=(0.011, -0.599), resolution=(1080, 1920)), "判断是否存在轮播图1")
wait(Template(r"tpl1589443018000.png", record_pos=(-0.013, -0.618), resolution=(1080, 1920)),timeout=15)
assert_exists(Template(r"tpl1589443048510.png", record_pos=(0.007, -0.591), resolution=(1080, 1920)), "判断是否存在轮播图2")
wait(Template(r"tpl1588217946022.png", record_pos=(-0.003, -0.808), resolution=(1080, 1920)),timeout=10)

assert_exists(Template(r"tpl1588217724067.png", record_pos=(0.003, -0.805), resolution=(1080, 1920)), "判断是否加载模板成功")  # 是否存在百度，证明一个demo完成
assert_exists(Template(r"tpl1589442781854.png", record_pos=(-0.124, -0.225), resolution=(1080, 1920)), "判断是否有天气组件")
assert_exists(Template(r"tpl1589442815098.png", record_pos=(-0.359, -0.261), resolution=(1080, 1920)), "判断是否有天气组件-度数")


touch(Template(r"tpl1589443129683.png", record_pos=(0.177, 0.431), resolution=(1080, 1920)))
assert_exists(Template(r"tpl1589443147933.png", record_pos=(-0.003, -0.407), resolution=(1080, 1920)), "判断是否存在精彩活动页")
touch(Template(r"tpl1589443336505.png", record_pos=(-0.017, 0.776), resolution=(1080, 1920)))
assert_exists(Template(r"tpl1589443350497.png", record_pos=(-0.019, 0.667), resolution=(1080, 1920)), "判断是否回到了首页")
touch(Template(r"tpl1589443365511.png", record_pos=(-0.292, 0.452), resolution=(1080, 1920)))
assert_exists(Template(r"tpl1589443619499.png", record_pos=(0.008, -0.186), resolution=(1080, 1920)), "店铺列表是否存在")


touch(Template(r"tpl1589443686099.png", record_pos=(-0.32, -0.658), resolution=(1080, 1920)))


assert_exists(Template(r"tpl1589443661396.png", record_pos=(0.002, -0.506), resolution=(1080, 1920)), "判断店铺详情是否存在")

touch(Template(r"tpl1589443699674.png", record_pos=(0.398, -0.794), resolution=(1080, 1920)))



























